import * as actionType from './constants'
import {reqdetail} from '../../../api/index'

export const changeDetailData = (data) =>{
    return {
        type:actionType.CHANGE_DETAIL_DATA,
        data
    }
}


//这里是异步的action , 可以获取 接口中的数据
 export const getDetailData = (id) =>{
     return (dispatch) =>{
         reqdetail(id)
            .then(data =>{
                // console.log(data,'/////');
                dispatch({
                    type:actionType.CHANGE_DETAIL_DATA,
                    data:data.data.data
                })
            })
     }
 }